package com.zsk.shop.enums;

public enum EnumCheckPwd {
    YES("手机号密码校验通过。", 1),
    PWD_ERROR("账号或密码错误。", 2),
    PWD_NULL("账号密码未设置，请使用验证码登录。", 3),
    NULL_PHONE("没有该手机号的注册信息。", 4),
    LOG_OUT_ACCOUNT("该手机号账号已注销,请重新注册。", 5),
    INVALID_PHONE("该账号已被禁用。", 6);

    String name;
    Integer code;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    EnumCheckPwd(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static String getNameByCode(Integer code) {
        EnumCheckPwd[] enums = EnumCheckPwd.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getName();
            }
        }
        return "";
    }

}
